<!DOCTYPE html>
<html  xmlns:th="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{$settingName}管理后台</title>
    {include file="public/resource/layui_css" /}
    <style type="text/css">
        .layadmin-iframe {
            position: absolute;
            width: 100%;
            height: 100%;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0
        }
    </style>
</head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">{$settingName}</div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="/" target="_blank">前台首页</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;" style="margin-right: 5px;">
                    {$nickname}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;" id="edit-password">修改密码</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="javascript:;" id="logout">退出登录</a></li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed layui-this">
                    <a href="/admin/main/home" target="frame">控制台</a>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">分类管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/category" target="frame">分类列表</a></dd>
                        <dd><a href="/admin/category/add" target="frame">添加分类</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">文章管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/article" target="frame">文章列表</a></dd>
                        <dd><a href="/admin/article/add" target="frame">添加文章</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">单页管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/page" target="frame">单页列表</a></dd>
                        <dd><a href="/admin/page/add" target="frame">添加单页</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">链接管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/link" target="frame">链接列表</a></dd>
                        <dd><a href="/admin/link/add" target="frame">添加链接</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">配置管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/setting" target="frame">配置设置</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-body" id="layui-body">
        <iframe id="main" src="/admin/main/home" name="frame" frameborder="0" scrolling="yes" class="layadmin-iframe"></iframe>
    </div>
    <div class="layui-footer">
        {include file="public/footer" /}
    </div>
</div>
{include file="public/resource/layui_js" /}
<script>
    layui.use('element', function() {
        let element = layui.element,$ = layui.jquery, layer = layui.layer;
        $("#edit-password").click(function () {
            $("#main").attr("src","/admin/user/password");
        })
        $("#logout").click(function () {
            layer.confirm("确认退出登录吗？", function (index) {
                location.href = '/admin/user/logout';
                layer.close(index);
            });
        });
    });
</script>
</body>

</html>